package com.ruangong.GitClient.app.TravelExpense;

import com.ruangong.GitClient.app.TravelExpense.Expense;

import java.io.Serializable;
import java.util.List;

public class TravelEvent implements Serializable {
    private int id; // 添加一个 id 属性
    private String name;
    private int numberOfPeople;
    private List<Expense> expenses;

    // Constructor
    public TravelEvent(int id, String name, int numberOfPeople) {
        this.id = id;
        this.name = name;
        this.numberOfPeople = numberOfPeople;
    }

    // Getter and setter for id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    // Getters and setters for name and numberOfPeople remain unchanged

    // Getter and setter for name
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // Getter and setter for numberOfPeople
    public int getNumberOfPeople() {
        return numberOfPeople;
    }

    public void setNumberOfPeople(int numberOfPeople) {
        this.numberOfPeople = numberOfPeople;
    }

    // Method to get list of expenses associated with this travel event
    public List<Expense> getExpenses() {
        return expenses;
    }

    // Method to set list of expenses associated with this travel event
    public void setExpenses(List<Expense> expenses) {
        this.expenses = expenses;
    }

    // Method to add a single expense to the list of expenses
    public void addExpense(Expense expense) {
        expenses.add(expense);
    }

    // Method to remove a single expense from the list of expenses
    public void removeExpense(Expense expense) {
        expenses.remove(expense);
    }

    // Other methods related to expenses can be added here
}



